package com.galaxy.payment.api;

import com.galaxy.common.core.domain.R;
import com.galaxy.common.core.exception.ServiceException;
import com.galaxy.payment.domain.PaymentRequestDTO;
import com.galaxy.payment.domain.bo.PaymentBo;
import com.galaxy.payment.service.IAliPayService;
import com.galaxy.payment.service.IBalanceService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/api/payment/balance")
@RequiredArgsConstructor
public class BalanceController {

    @Autowired
    private IBalanceService billingService;

    @PostMapping("/create")
    public R<Boolean> createPay(@RequestBody PaymentBo paymentRequest) {
        return R.ok(billingService.createPayByBalance(paymentRequest));
    }
}
